﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Common.Objects.Enums;
using EYCmsAdmin.Domain.Models;
using EYCmsAdmin.Presentation.Models.BaseModels;
using Tools.Utilities;

namespace EYCmsAdmin.Presentation.Models.UserModels
{
    public class UserEditModel : BasePresentationModel
    {
        public UserEditModel()
        {
        }

        public UserEditModel(User user)
        {
            Login = user.Login;
            Password = user.Password;
            Email = user.Email;
            IsDeleted = user.IsDeleted;
            IsDeactivated = user.IsDeactivated;
            Name = user.UserInfo.Name;
            Surname = user.UserInfo.Surname;
            GenderId = (int)user.UserInfo.Gender;
            DateBirth = user.UserInfo.DateBirth.ToString(StringUtils.DayMonthYearFormat);
        }

        public string Login { get; set; }

        public string Password { get; set; }

        public string Email { get; set; }

        public bool IsDeleted { get; set; }

        public bool IsDeactivated { get; set; }

        public string Name { get; set; }

        public string Surname { get; set; }

        public int GenderId { get; set; }

        public string DateBirth { get; set; }

        public IList<SelectListItem> Roles { get; set; }

        public IList<SelectListItem> GenderTypeses { get; set; }
    }
}